package com.ruyuan.ingestion.parser;
import com.ruyuan.ingestion.common.Parsable;

public abstract class TrainParser<T> implements Parsable<T> {
    @Override
    public Boolean isHeader(String[] fields) {
        //user,event,invited,timestamp,interested,not_interested

        return (isValid(fields)
                && fields[0].equals("user")
                && fields[0].equals("event")
                && fields[0].equals("invited")
                && fields[0].equals("timestamp")
                && fields[0].equals("interested")
                && fields[0].equals("not_interested"))
                ;
    }

    @Override
    public Boolean isValid(String[] fields) {
        return (fields.length > 5 && isEmpty(fields,new int[] {0,1}));
    }
}
